<?php

namespace Content;

/**
 * 增加管理员
 */
class ContentAddFormModel extends \Forms\FormBase
{
    /**
     * 设置所有的字段
     */
    protected $_fields = array(
        'content_title' => array(
            'label' => '内容标题',
            'name' => 'content_title',
            'require' => true,
            'message' => '不能为空',
            'validate' => array(
                array('type' => 'string', 'min' => '1', 'max' => '45', 'msg' => '内容标题错误')
            ),
        ),
        'category_id' => array(
            'label' => 'category_id',
            'name' => 'category_id',
            'require' => true,
            'message' => '分类错误',
            'validate' => array(
                array('type' => 'int', 'min' => '1', 'msg' => '分类错误')
            ),
        ),
        'content' => array(
            'label' => '内容',
            'name' => 'content',
            'require' => true,
            'message' => '不能为空',
            'validate' => array(
                array('type' => 'string', 'min' => '1', 'max' => '1000', 'msg' => '内容内容错误')
            ),
        ),
        'content_image' => array(
            'label' => '内容图片',
            'name' => 'content_image',
            'require' => false,
            'message' => '内容图片错误',
            'validate' => array(
                array('type' => 'string', 'min' => '1', 'max' => '500', 'msg' => '内容图片错误')
            ),
        ),
        'status' => array(
            'label' => 'status',
            'name' => 'status',
            'require' => true,
            'message' => '状态错误',
            'validate' => array(
                array('type' => 'int', 'min' => '1', 'max' => '2', 'msg' => '状态错误')
            ),
        ),
        'add_time' => array(
            'label' => 'add_time',
            'name' => 'add_time',
            'require' => false,
            'message' => '时间'
        ),
//        'source'       => array(
//            'label'   => 'source',
//            'name'    => 'source',
//            'require' => false,
//            'message' => '来源'
//        ),
    );

}
